<?

	/* Theme functions, these are called from the main theme or the blog system */
	
	
	function drawProfile() {
		global $blogname;
		
		echo "\r\n";
		echo "\t<div id='profile'>\r\n";
//		echo "\t\t<img src='http://s3.amazonaws.com/twitter_production/profile_images/74182347/jan2008.png'/>\r\n";
		echo "\t\t<h1><a href='?'>".$blogname."</a></h1>";
		echo "\r\n";
		echo "\t</div>";
		echo "<div style='clear:both;'> </div>";
	}
	


	
	
	function get_gtalkStatus($ffuser) {
		$ffurl = "http://friendfeed.com/".$ffuser."?service=googletalk&format=atom";

		$entry=-1;
		if ($fd = @fopen($ffurl,"r")) {
			do{
				$line = fgets( $fd, 2000);
				//print "[".$line."]<br/>";
				
				if (ereg("<title ",$line)) $entry++;
				if ($entry>=0) {		
					if (ereg("<title type=\"text\">",$line)) {
						$author[$entry] = substr($line,19,-33);		
					}else if (ereg("<issued>",$line)) {
						$dagdatumenuur = explode("T",substr($line,8,-19));
						$date[$entry]=$dagdatumenuur[0];
						$time[$entry]=$dagdatumenuur[1];
					}else if (ereg("rel=\"alternate\"",$line)) {
						$link[$entry] = substr($line,6,-3);
					}else if (ereg("<title",$line)) {
						$title[$entry] = substr($line,39,-9);
					}
				}	
			}while(!feof($fd) && $entry!=1);
			fclose ($fd);
			
			
			/*=============================output=============================*/
			print $author[1];
		}	
	}





?>
